﻿<div id="header">
<div id="nav">
	<div id="box-menu-top">
		<!-- begin menu -->
		<div class="box-menu">
		    <a href="<?=$root?>/trang-chu/" <?php if($_SERVER['REQUEST_URI'] == $root.'/trang-chu/' || $_SERVER['REQUEST_URI'] == $root."/"){?> class="btnMenuSelect"<?php } else{?> class="btnMenu" <? }?>>
				<div <?php if($_SERVER['REQUEST_URI'] == $root.'/trang-chu/' || $_SERVER['REQUEST_URI'] == $root."/"){?> class="btnMenuSelectText"<?php } else{?> class="btnMenuText" <? }?>>Trang ch&#7911;</div>
			</a>
			<?
				$rs = $db->query("select * from ".$prefix."loaisanpham where c_hienthi = 1 and c_id_cha = 0 order by c_thutu ASC");
				while($row = $db->fetch_array($rs)){
					$c_ten = stripslashes($row[c_ten]);
					$c_id = $row[c_id];
			?>
			<a href="<?=$root?>/danh-muc-san-pham/<?=$c_id?>/<?=$myString->vietdecode($c_ten)?>" <?php if($_SERVER['REQUEST_URI'] == $root.'/danh-muc-san-pham/'.$c_id.'/'.$myString->vietdecode($c_ten)){?> class="btnMenuSelect"<?php } else{?> class="btnMenu" <? }?> >
				<div <?php if($_SERVER['REQUEST_URI'] == $root.'/danh-muc-san-pham/'.$c_id.'/'.$myString->vietdecode($c_ten)){?> class="btnMenuSelectText"<?php; $global_id=$c_id; $global_ten=$c_ten; } else{?> class="btnMenuText" <? }?> ><?=$c_ten?></div>
			</a>
			<? } ?>
			<a href="<?=$root?>/rao-vat/" <?php if($_SERVER['REQUEST_URI'] == $root.'/rao-vat/'){?> class="btnMenuSelect"<?php } else{?> class="btnMenu" <? }?>>
				<div <?php if($_SERVER['REQUEST_URI'] == $root.'/rao-vat/'){?> class="btnMenuSelectText"<?php } else{?> class="btnMenuText" <? }?>>Rao v&#7863;t</div>
			</a>
		</div>
		<!-- end menu -->
		<div class="box-menu-text">
			<?
				if($_SESSION['is_login'] != true){
			?>
			<div class="btnTutor">
				<a class="btnTutor" href="javascript:void(0);">
					<b>H&#432;&#7899;ng d&#7851;n</b>
				</a>
			</div>
			<div class="btnLogin">
				<a class="btnLogin" href="<?=$root?>/dang-nhap/" title="Đăng nhập">
					<b>&#272;&#259;ng nh&#7853;p</b>
				</a>
			</div>
			<span class="sepera"></span>
			<div class="btnRegister">
				<a class="btnRegister" href="<?=$root?>/dang-ky/">
					<b>&#272;&#259;ng k&#253;</b>
				</a>
			</div>
			<? }else{ ?>			
			<span class="sepera"></span>
			<div class="btnProducts">
				<a href="<?=$root?>/luu-san-pham/">S&#7843;n ph&#7849;m <br/> &#273;&#227; l&#432;u </a>(<strong><?=loadSoSanPhamLuu($_SESSION['uid'])?></strong>)
			</div>				
			<div class="btnPm">
				<a href="<?=$root?>/tin-nhan/" title="Tin nhắn">Tin <br/> nh&#7855;n</a> (<strong><?=loadSoTinNhan($_SESSION['uid'])?></strong>)
			</div>
			<span class="sepera"></span>
			<div class="btnAccount">
				<a title="Cập nhật tài khoản: <?=$_SESSION['uname']?>" href="<?=$root?>/thay-doi-thong-tin/"><b><?=$myString->cutString2($_SESSION['uname'],6)?></b></a> [<a href="<?=$root?>/thoat/" title="Thoát">Tho&#225;t</a>] <br/>
				<a href="<?=$root?>/shop-<?=$_SESSION['uid']?>/<?=$_SESSION['uname']?>" title="Shop của <?=$_SESSION['uname']?>"><span><b>| [Shop]</b></span></a>
			</div>
			<span class="sepera"></span>
			<? } ?>		
		</div>		
	</div>	
</div>	
<!-- begin banner -->
<div id="banner">
	<div class="content">
		<div class="logo">
			<a href="<?=$root?>/trang-chu/">
				<img alt="VMua" src="<?=$root?>/themes/img/logo2.jpg"/>
			</a>
		</div>
		<div class="search">
			<script language="javascript">
				function uniKey(){
					
					var a = document.getElementById('avim');
					if(a.alt == '1'){
						a.alt = '0';
						a.src = '<?=$root?>/themes/images/form/uk_off.gif';
						
					}else{
						a.alt = '1';
						a.src = '<?=$root?>/themes/images/form/uk_on.gif';
					}
				}
				
				function funSearch(){
					var a = document.getElementById('keyword');
					if(a.value != ''){
						window.location = '<?=$root?>/?mod=timkiem&keyword=' + a.value;
					}else{ return false; }
				}
			</script>			
			<div id="bgsearch">
				<div class="search-left">					
					<input type="text" class="keyword" value="Nh&#7853;p t&#7915; kh&#243;a" onfocus="if(this.value=='Nh&#7853;p t&#7915; kh&#243;a') this.value = '';" onblur="if(this.value=='') this.value='Nh&#7853;p t&#7915; kh&#243;a';" name="keyword" id="keyword"/>
				</div>
				<div class="btnSearch-bg">
					<input type="button" class="btnSearch" onclick="funSearch();"/>
				</div>
				
			</div>
		</div>
	</div>
	<div class="support">
		<div class="link-random">
			<div class="rateChange">T&#7881; gi&#225; tham kh&#7843;o: <b>
			<script type="text/javascript" language="JavaScript" src="http://vnexpress.net/Service/Forex_Content.js"></Script>
			<script language="javascript">
				document.writeln(vCosts[0]);
			</script>
			</script>
            VN&#272;/USD</b></div>
		</div>
		<div class="dang_ban">
			<a href="<?=$root?>/dang-ban/" class="btndang_ban"></a>
		</div>
	</div>
	<div class="clearfix"></div>
</div>
<?
	file_exists("includes/inc_nav_menu.php");
	include("includes/inc_nav_menu.php");
?>
</div>